import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

// 获取已办任务
export function queryToDonePage(query: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/todone/page", {
    params: query
  });
}

// 获取节点配置信息
export function queryToDoneDetail(query: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/todone/detail", {
    params: query
  });
}

// 获取待办任务
export function queryTodoPage(query: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/todo/page", {
    params: query
  });
}

// 获取待办任务数量
export function queryTodoSize(query: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/todo/size", {
    params: query
  });
}

// 审批前获取节点配置信息
export function queryTodoDetail(query: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/todo/detail", {
    params: query
  });
}

export function queryToSignTable(params: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/tosign/page", {
    params: params
  });
}

export function queryTaskProgress(flowInstId: string) {
  return http.request<HttpResult>(
    "get",
    `/esflow/task/get/progress/${flowInstId}`
  );
}

export function queryToSignSize(params?: object) {
  return http.request<HttpResult>("get", "/esflow/task/get/tosign/size", {
    params: params
  });
}
